// //聚焦失焦
let psd01=document.getElementById("psd01")
psd01.onfocus=function(){
	this.style.border="1px solid blue"
}
psd01.onblur=function(){
	this.style.border="1px solid gray";
	if(this.value==""){
		$("#msg01").css({"display":"block"})
	}
}
let psd02=document.getElementById("psd02")
psd02.onfocus=function(){
	this.style.border="1px solid blue"
}
psd02.onblur=function(){
	this.style.border="1px solid gray"
	if(this.value==""){
		$("#msg02").css({"display":"block"})
	}
}
//设置密码
$("#psd01").blur(function(){
	let regExp=/^\w{6}$/;
	if(!regExp.test(this.value)){
		$("#msg01").html("密码格式不正确，请输入6-18位组合密码").css({
			"display":"block",
			"color":"red"
		});
	}
	else{
		
		$("#msg01").html("正确√").css({
			"display":"block",
			"color":"blue"
		})
	}
})
//确认密码
$("#psd02").blur(function(){
	if($("#psd02").val() !==$("#psd01").val()){
		$("#msg02").html("两次密码不一致，请重新输入").css({
			"display":"block",
			"color":"red"
		})
	}
	else{
		$("#msg02").html("正确√").css({
			"display":"block",
			"color":"blue"
		})
	}
})